function [hog rectStruct] = makeHogAndRect(im, r);

r = round(r);
ra = r(1):r(1)+r(3);
rb = r(2):r(2)+r(4);

pixelData = im(rb,ra,:);
im = imresize(pixelData,[100 50]);  % resize to consistent image
hog = vl_hog(single(im), 10);       % ... to easily compute HoG

rectStruct = struct('r', r, ...
    'ra', ra,...
    'rb', rb,...
    'pixelData', pixelData);


